<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>帖子鉴定</title>
    <link rel="stylesheet" href="${base}/layui/css/layui.css">
    <link rel="stylesheet" href="${base}/awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="${base}/css/admin.css">
    <link rel="stylesheet" href="${base}/css/lightcase.css">
    <style>
    	.layui-bg-black{        width: 200px;height: 136px;margin-right: 30px;float: left;text-align: center;font-size: 33px;color: #000000!important;padding-top: 30px;}
    	.checkbox{display: inline-block;}
    	.layui-form-item{font-size: 18px;}
    	.layui-select{float: left;}
    </style>
</head>
<body  class="layui-layout-body" style="overflow:scroll;">
<#include "/common/left.flt">	
<div class="layui-main" style="position: absolute;left: 205px;top: 20px; width: calc(100% - 210px);" >
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
  <legend>操作提示</legend>
</fieldset>
<blockquote class="layui-elem-quote layui-quote-nm">
 	<form action="${base}/pulp/cardList" method="post" id="dataForm">
        <input type="hidden" id="page" name="page" value="1"/>
        <div class="layui-input-inline" >
        	<label class="layui-form-label">检测结果:</label><select name="label" id="label" class="width100 layui-select">
        	 	<option  value=''>全部结果</option>
                <option   value='0'>色情</option>
                <option   value='1'>性感</option>
                <option   value='2'>正常</option>
      		</select>
      		<label class="layui-form-label">处理状态:</label><select name="status" id="status" class="width100 layui-select">
        		<option  value=''>全部</option>
             	<option   value='1'>系统已处理</option>
             	<option   value='2'>未处理</option>
      		</select>
      		<label class="layui-form-label">分数:</label><select name="score" id="score" class="width100 layui-select">
        		<option value=''>默认排序</option>
                <option  value='a.score desc'>检测数值倒序</option>
                <option  value='a.score'>检测数值正序</option>
      		</select>
      		<label class="layui-form-label">检测时间:</label><select name="create_time" id="create_time" class="width100 layui-select">
        		<option value=''>默认排序</option>
                <option  value='a.create_time desc'>最新</option>
                <option  value='a.create_time'>最旧</option>
      		</select>
      		<button class="layui-btn" lay-submit=""> <span class="fa fa-search"></span> 查询</button>
 		</div>
        
    </form>
</blockquote> 

<div class="layui-btn-container">
  <button class="layui-btn layui-btn-sm" id="restored">还原</button>
  <button class="layui-btn layui-btn-sm" id="unpass">替换</button>
  <button class="layui-btn layui-btn-sm" id="pass" >人工确认（删除记录）</button>
</div>
<table class="layui-table" >
	<thead>
         <tr>
            <th><input type="checkbox" id="all" />编号</th>
            <th>图片</th>
            <th>图片来源</th>
            <th>帖子id</th>
            <th>用户id</th>
            <th>昵称</th>
            <th>手机号</th>
            <th>检测结果</th>
            <th>检测数值</th>
            <th>处理状态</th>
            <th>检测时间</th>
        </tr>
     </thead>
     <tbody>
     <#list page.list as one>
     <tr>
     	<td><input type="checkbox" name="id" value="${one.id}" /> ${one.id}</td>
     	<td>
     	  <a data-rel="lightcase:myCollection:slideshow" title="" href="${one.img?default('')}">
             <img width="100" height="100" src="${one.img?default('')}" />
          </a>
		</td>
     	<td>帖子</td>
     	<td><a href="${base}/card_list/detail?id=${one.card_id?default('0')}" target="_blank">${one.card_id?default('')}</a></td>
     	<td><a href="${base}/users_list/detail?user_id=${one.user_id?default('0')}" target="_blank">${one.user_id?default('')}</a></td>
     	<td><script>document.write(decodeURIComponent("${one.nick_name?default('')}"));</script></td>
     	<td>${one.user_mobile?default('')}</td>
     	<td title="${one.message?default('')}">${one.label_name?default('')}</td>
     	<td>${one.score?default('')}</td>
     	<td>${one.status_name?default('')}</td>
     	<td>${one.create_time_string?default('')} </td>
     </tr>
     </#list>
     </tbody>
</table>
<div id="pageDiv"></div>
</body>
<script src="${base}/js/jquery-2.1.4.min.js" type="text/javascript"></script>
<script src="${base}/js/lightcase.js" type="text/javascript"></script>
<script src="${base}/layui/layui.all.js"></script>
<script type="text/javascript">
$("#label").val('${label?default('')}');
$("#status").val('${status?default('')}');
$("#score").val('${score?default('')}');
$("#create_time").val('${create_time?default('')}');

layui.use('laypage',function () {
    var laypage = layui.laypage ;
    laypage.render({
        elem:"pageDiv",
        count:${page.totalPage*30},
        limit:30,
        curr:${page.pageNumber},
        layout:['count','prev','page','next','skip'],
        jump:function (obj,first) {
            var page = obj.curr;
            if(!first){
                $("#page").val(page);
                $("#dataForm").submit();
            }
        }
    });
});


$('a[data-rel^=lightcase]').lightcase({
    transition : 'elastic',//过渡动画 "none"、"scrollTop"、“fade”、“elastic”
});
$('a[data-rel="lightcase:myCollection:slideshow"]').lightcase({
    transition: 'scrollHorizontal',
    slideshowAutoStart:false
});
$("#restored").click(function (){
	var values = "";
	var i = 0;
	$("input[name='id']").each(function(){
		if ($(this).is(':checked')){
			values = values + $(this).attr("value") +",";
			i = i + 1;
		}
	});
	if (i > 0){
		$.post("${base}/pulp/restored",
        		{"ids":values},function(data){ 
        			layer.alert(data);
        			window.location.reload();
        		}
        );
	} else {
		layer.msg("没有选择记录！");
	}
});

$("#unpass").click(function (){
	var values = "";
	var i = 0;
	$("input[name='id']").each(function(){
		if ($(this).is(':checked')){
			values = values + $(this).attr("value") +",";
			i = i + 1;
		}
	});
	if (i > 0){
		$.post("${base}/pulp/unpass",
        		{"ids":values},function(data){ 
        			layer.alert(data);
        			window.location.reload();
        		}
        );
	} else {
		layer.msg("没有选择记录！");
	}
});

$("#pass").click(function (){
	var values = "";
	var i = 0;
	$("input[name='id']").each(function(){
		if ($(this).is(':checked')){
			values = values + $(this).attr("value") +",";
			i = i + 1;
		}
	});
	if (i > 0){
		$.post("${base}/pulp/pass",
        		{"ids":values},function(data){ 
        			layer.alert(data);
        			window.location.reload();
        		}
        );
	} else {
		layer.msg("没有选择记录！");
	}
});

$("#all").click(function (){
	if ($("#all").prop("checked")) {
		$("input[name='id']").prop("checked", true);
	} else {
		$("input[name='id']").prop("checked", false);
	}
});

</script>
</html>